﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Trans.order
{
    public partial class Manage_allOrders : Form
    {
        public Manage_allOrders()
        {
            InitializeComponent();
        }

        private void Manage_allOrders_Load(object sender, EventArgs e)
        {
 
            this.tb_cityTableAdapter.Fill(this.dataSet.tb_city);
            this.tb_customerTableAdapter.Fill(this.dataSet.tb_customer);
            this.tb_orderTableAdapter.Fill(this.dataSet.tb_order);                

        }

        private void bt_add_Click(object sender, EventArgs e)
        {

                try
                {
                    tborderBindingSource.EndEdit();
                    tb_orderTableAdapter.Update(dataSet.tb_order);
                    this.Close();
                    MessageBox.Show("操作成功", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show("出错啦" + ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            
        }

        private void bt_cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void goods_gridview_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            session.Color_Const.set_gv_color(goods_gridview);
        }
    }
}
